package com.heima.article.controller.v1;

import com.heima.api.behavior.IBehaviorClient;
import com.heima.article.service.ApArticleService;
import com.heima.common.constants.ArticleConstants;
import com.heima.model.article.dtos.ApArticleDto;
import com.heima.model.article.dtos.ApArticleHomeDto;
import com.heima.model.behavior.dtos.ArticleInfoDto;
import com.heima.model.behavior.dtos.CollectionBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.utils.common.WmThreadLocalUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description TODO
 * @Author bo.li
 * @Date 2023/3/14 9:47
 * @Version 1.0
 */
@RestController
@RequestMapping("/api/v1")
@Slf4j
public class ApArticleCollectionController {
    @Autowired
    private IBehaviorClient behaviorClient;
    @Autowired
    private ApArticleService articleService;
    @PostMapping("/collection_behavior")
    public ResponseResult collectionBehavior(@RequestBody CollectionBehaviorDto dto) {
        dto.setUserId(WmThreadLocalUtil.getUser().getId());
        log.info("收藏文章行为,dto:{}",dto);
        return behaviorClient.collectionBehavior(dto);
    }
    }